<#include  "/common/csharp.ftl">
<?xml version="1.0" encoding="UTF-8" ?>
<#list doc.entitymodel.entity as entity>
<#if entity.@entity_name=object()>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
	<class name="pos.entity.${entity.@entity_name?cap_first},pos" table="t_${entity.@entity_name}">
		<id name="${entity.prim_key.@field}" >
		<generator class="${entity.prim_key.@generator}"/>
		</id>
	<#list entity.field as field>
		<#if entity.prim_key.@field=field.@name >
		<#else>
		${"<"}property column="${field.@name}" 
		<#if (field.@length?if_exists?size>0)> length="${field.@length}"</#if> name="${(field.@name="value")?string("value",field.@name)}" type="<@fieldToHiberateType field=field/>" ${"/>"}
		</#if>
	</#list>
	<#list entity.relation as r >
		${r.@@nested_markup?replace("java.util.Set"," Iesi.Collections.ISet")?replace(entity.@package_name,"pos.entity")}
	</#list>
	</class>
</hibernate-mapping>
<#break>
</#if>
</#list>